window.onload = function () {
    // 获取所有的表单元素
    var inputUser = document.querySelector("input")
    var inputPwd = document.querySelector(".password").querySelector("input")
    // 获取密码表单
    var pwd = document.querySelector(".password").querySelector("input")
    // 获取图标
    var eye = document.querySelector(".password").querySelector("span").querySelector("img")

    // 鼠标经过表单时编辑框提示内容消失
    inputUser.onmouseover = function () {
        inputUser.placeholder = ""
    }
    inputPwd.onmouseover = function () {
        inputPwd.placeholder = ""
    }

    // 鼠标离开表单时编辑框内容出现

    inputUser.onmouseleave = function () {
        inputUser.placeholder = "用户名"
    }
    inputPwd.onmouseleave = function () {
        inputPwd.placeholder = "密码"
    }

    // 点击眼睛进行明暗文切换
    var status = 1;
    eye.onclick = function () {
        console.log(status);
        if (status == 1) {
            eye.src = "../img/icon/眼睛_显示_o (2).png"
            pwd.type = "text"
            status = 2
        } else {
            eye.src = "../img/icon/眼睛_隐藏_o (1).png"
            pwd.type = "password"
            status = 1
        }

        console.log(status);


    }
}